package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.Article;
import com.ruoyi.system.api.factory.RemoteActivityFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteArticleService",value = ServiceNameConstants.BLOG_SERVICE,fallbackFactory = RemoteActivityFallbackFactory.class)
public interface RemoteArticleService {

    @PostMapping("/article/inner/add")
    public AjaxResult addInner(@RequestBody Article article, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @GetMapping("/article/inner/get")
    public R<Article> get(@RequestParam("id")Long id, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    @PostMapping("/article/inner/getBody")
    public R<List<Article>> getBody(@RequestBody Article article, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);


    @PostMapping("/article/inner/update")
    public R<Article> innerUpdate(@RequestBody Article article, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);
}
